<%@page import="tr.com.argela.tap.mot.models.User"%>
<%@page import="tr.com.argela.tap.mot.models.Module"%>
<%@page import="tr.com.argela.tap.mot.models.TestPoint"%>
<%@page import="tr.com.argela.tap.mot.dao.AuthenticationDao"%>
<%@page import="tr.com.argela.tap.mot.dao.TestPointDao"%>
<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
   
   
   <html>
   
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link rel="stylesheet" type="text/css" href="style/styles.css">
    </head>
    <%
     User user = (User)request.getSession().getAttribute("userObject");
     String name = user.getName();
     
%>
    <body>
    <h4 align="right">Welcome <%=name%></h4>
    <h5 align="right"><a href="logout.jsp">Log out</a></h5>
       <div  align="center"> <h1 align="center">MOT</h1><h5 align="center">Memory Of Testing</h5></div>
        
        <dıv  align="left">
        <table align="left">
             <tr><td>
	        <h4><a href="currentProjects.jsp">Current Projects</a></h4>
	    </td></tr>
	      <tr><td>
	      	<h4><a href="createProject.jsp">Create Project</a></h4>
	    </td></tr>
	       <tr><td>
	         <h4><a href="projectVersion.jsp">Create Project Version</a></h4>
	    </td></tr>
	       
	        <tr><td>
	          <h4><a href="users.jsp">Users</a></h4>
	    </td></tr>
	        <tr><td>
	           <h4><a href="export.jsp">Export Document</a></h4>
	    </td></tr>
        </table>
        </dıv>

     <form action="TestCaseServlet">
    <table border="3" align="center">
    <tr><th colspan="2"> Create New Test Case </th></tr>
    <tr><td>Test Case Name: </td><td><input type="text" name="tcname"></td></tr>
    <tr><td>BRQ:</td><td><input type="text" name="brq"></td></tr>
       <tr><td>Select TestPoint : </td><td><select name="testpointname">
		    <%
		TestPointDao testpointdao = new TestPointDao();
		List<TestPoint> testpoints = testpointdao.seepointlist();
		
		for (TestPoint testpoint : testpoints) {
		%> 
		<option value="<%=testpoint.getId()%>" ><%=testpoint.getName()%></option>
		
		<% }
		
	%>
    
	</select></td></tr>
    <tr><td>Precondition:</td><td><input type="text" name="precon"></td></tr>
    <tr><td>Test Definition:</td><td><input type="text" name="definition"></td></tr>
    <tr><td>Expected Result:</td><td><input type="text" name="expected"></td></tr>
    <tr><td>Check Items:</td><td><input type="text" name="check"></td></tr>
    <tr><td>Notes:</td><td><input type="text" name="notes"></td></tr>
    <tr><td>Art No:</td><td><input type="text" name="art"></td></tr>
    <tr><td>Select Dependent People:</td>
    <td><select name="username">
	 <% 
		AuthenticationDao autDao = new AuthenticationDao();
		
		List<User> users = autDao.seeUsers();
		
		for (User userli : users) {
		%> 
		<option value="<%=userli.getId()%>" ><%=userli.getName()%></option>
		
		<% }
		
	%>
    
	</select></td></tr>
    <tr><td colspan="2" align="center"><input  type="hidden" name="case" id="case" value="createtestcase"/><input type="submit" name="newtc" value="Save"><input type="reset" name="cancel" value="cancel">
    </td></tr></table></form>